/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/* 
 * Copyright (c) 2009 City University of Hong Kong
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License m_version 2 as
 * published by the Free Software Foundation;
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 * 
 * Author: Wilson Thong (wilsonwk@ee.cityu.edu.hk) 
 */
#ifndef ROUTING_TOOLS_H
#define ROUTING_TOOLS_H

#include "ns3/point-to-point-net-device.h"
#include "ns3/ipv4-route.h"
#include "ns3/ipv4-routing-table-entry.h"
#include "ns3/ipv4.h"
#include "ns3/ipv4-list-routing-helper.h"

namespace ns3 {
namespace eecityu {

/**
 * \brief Convert an Ipv4RoutingTableEntry object into an Ipv4Route object
 * \param in An routing table entry
 * \param preferredRoute The route returned from a shortest path routing table
 * \param ipv4 An ipv4 object associated with a node
 * \return The output Ipv4Route object
 */
Ptr<Ipv4Route>
GetIpv4RouteFrom (const Ipv4RoutingTableEntry& in, Ptr<Ipv4Route> preferredRoute, Ptr<Ipv4> ipv4);

/**
 * \brief Get the IPv4 address associated to the opposite net device
 * at the next hop
 * \param dev The net device on the local node
 * \return The IPv4 address at the opposite side of the local net device 
 */
Ipv4Address 
GetRemoteAddress (Ptr<PointToPointNetDevice> dev);

} // namespace eecityu
} // namespace ns3

#endif // #ifndef ROUTING_TOOLS_H
